package com.vehicle.auto.click.test;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FirstScript {
    public static void main(String[] args) {
        System.out.println("start selenium");
        System.setProperty("webdriver.firefox.bin", "D:\\MySoft\\firefox\\firefox.exe");
        System.setProperty("webdriver.gecko.driver", "D:\\yankong_tool\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(8L, TimeUnit.SECONDS);
        driver.get("http://www.baidu.com/");
        WebElement txtbox = driver.findElement(By.id("kw"));
        txtbox.sendKeys(new CharSequence[]{"selenium java"});
        WebElement btn = driver.findElement(By.id("su"));
        btn.click();
        System.out.println("end selenium");
    }
}
